//
//  ReadingNotesModel.m
//  优学荟管理系统
//
//  Created by 星道 on 17/6/29.
//  Copyright © 2017年 星道三好. All rights reserved.
//

#import "ReadingNotesModel.h"

@implementation ReadingNotesModel

//创建类
+ (instancetype)HNObjectValuesForKey:(NSDictionary *)Dict
{
    return [[self alloc] initWithHNObjectValuesForKey:Dict];
}

//实例化
- (instancetype)initWithHNObjectValuesForKey:(NSDictionary *)Dict
{
    self = [super init];
    if (self)
    {
        //KVC
        [self setValuesForKeysWithDictionary:Dict];
    }
    return self;
}

- (void)setValue:(id)value forUndefinedKey:(NSString *)key
{
    if ([key isEqualToString:@"book"])
    {
        self.name = value[@"name"];
    }

    if ([key isEqualToString:@"user"])
    {
        self.petName = value[@"petName"];
    }

    if ([key isEqualToString:@"id"])
    {
        self.ID = value;
    }
}

@end
